-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When given, use the sequence len for array_shape #3144
base: main
Are you sure you want to change the base?
Conversation
else: | ||
if shape := feature.length: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: For readability, collect int | None
instead of str, and clean afterwards when building the actual arrayShape.
array_shape: list[int | None] = []
...
array_shape.append(-1)
...
array_shape.append(feature.length)
...
array_shape.append(sub_feature.length)
...
str_array_shape = [str(shape) if shape else '-1' for shape in array_shape]
field["arrayShape"] = ",".join(str_array_shape)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, done.
@lhoestq could you PTAL? Thanks :) |
@lhoestq gentle ping :) |
I see that some datasets have the Sequence length defined, e.g.: https://datasets-server.huggingface.co/info?dataset=pollen-robotics/apple_storage
We should probably use this info.